/*********************************************************************************\

1.4B17


1.4B18
	// LRT - 96/11/17
	Changed transport title from "EnRoute inet" to "inet Mail"

	// LRT - 96/11/17
	Improved error handling for attempts to send messages for which there
	is not enough storage space.

	// LRT - 96/11/17
	Modified email address field parsing for incoming mail to correctly handle
	the case where a "From" address spans multiple lines


1.4B19
	// LRT - 96/11/19 5:17 PM
	Added code to handle filing as an action in the rules filter.

	// LRT - 96/11/19 5:17 PM
	Added "openViewsA" slot to preferences slip to allow tracking of all
	subordinate prefs views opened by extensions.

1.4B24
	// LRT - 96/12/02 11:57 AM
	Added check for missing owner & worksite in "N1_Transport" callback
	function "CB_ConnSlip_Inet" to abort if no userConfig value
	Bug:
		1607896 - error invoked if connecting and no owner has been created

1.4B25
	// LRT - 96/12/03 4:35 PM
	Switched to new 1.1 internet error message function when available
	in C_Transport function "MNotifyError"

1.4B25b
	// LRT - 96/12/04 5:30 PM
	Found the fix for Celso's -54002 bug during message Tx
	Output buffer's string might under certain circumstances be an
	empty string and cannot be output via the endpoint.
	Added tests in N1_Service functions "TxAsync" and "TxOutBuffFinal"
	to prevent this from being encountered.

1.4B25c
	// LRT - 96/12/04 8:32 PM
	Fixed bug which prevented reception of Eudora's attached text files.

	// LRT - 96/12/04 9:53 PM
	Modified Resolve URL so that it will identify and resolve URL strings
	in viewDefs other than the EnRoute mail text view


1.4FC02.4
	// LRT - 96/12/14 6:25 AM
	Completely rewrote the transport's ImportDisabled function to defer until
	after it might be possible for the transport to have been removed out
	from under the ImportDisabled function when both the EnRoute Core and the
	transport are deleted at the same time.
	Bug:
		1612857 - (-48411) & (-48221) when deleting EnRoute Core & transport


1.4FC03.2
	// LRT - 96/12/20 5:02 PM
	Changed logic to cause deletion to occur for ANY item marked for deletion by
	the POP List Manager (PLM). Deletion will now result unless the item was also
	marked by PLM to be read during the same session and the PLM-forced read failed.
	Bug:
		1614401 - User cannot delete partially downloadable messages

	// LRT - 96/12/20 7:03 PM
	Changed "grace period" for cancellation during an active server session
	from 60 seconds to 9 seconds.  This will mean that we'll kick the server off
	really fast which could upset some SMTP servers resulting in a server which
	won't allow login for a few minutes.  This will still feel better to the
	users who expect the cancel operation to respond immediately.
	Bug:
		1614984 - Cancel fails to bring NIE down

	// LRT - 96/12/20 8:43 PM
	Modified code around my call to "ItemCompleted" for items mailed when not
	enough memory was available to translate the content.
	Was using:
		:ItemCompleted ( msgItem, nil, msgErr );
	Switched to:
		RemoveSlot ( msgItem, 'connect );           // prevent re-open of route slip!
		RemoveSlot ( msgItem, 'encFrame );          // prevents message bloat!
		:ItemCompleted ( msgItem, 'nil, msgErr );

	This prevents the protoTransport code from attempting to reopen the routing
	slip for items which fail when being "mailed now" as this can cause problems
	under low memory conditions.

	Also added some in-your-face information in the status slip so that the
	user can see that there was no memory to send the item.  Before, the only
	feedback which they were getting was the message they'd see if they opened
	the items remaining in the out box.
	Bug:
		1613380 - Cannot send large spreadsheet (>10K)

	// LRT - 96/12/21 3:10 AM
	Modified Quoted-Printable translator to replace TAB characters with =09
	encoded value.  SMTP server at "ix.netcom.com" cannot accept body of mail
	message containing tab characters.  The server disconnects after timing out
	after we terminate the message body transmission with <CR><LF>.<CR><LF> as
	it doesn't seem to see the termination.
	This bug may relate to some of the problems which people encountered trying
	to email spreadsheets as the body text of these always contains many tabs.

	NOTE: This was the only problem which I encountered while connecting to Joe's
	Netcom account. The actual bug which he reported could not be reproduced.

1.4FC04.1
	// LRT - 96/12/23 1:15 PM
	Fix in transport's "CB_Link_Grab" for bug where CancelRequest was leaving
	the connect slip open because the transport was being cleaned too soon.

1.4FC04.2
	// LRT - 96/12/25 2:07 PM
	Send Now no longer sends all ready items from the out box. The folding of
	the "Send Now" function to also send all items from the out box had been
	done because many users felt that asking to send now meant that everything
	should be sent. We'll now go back to the Apple standard method where the
	routing slip will only cause the routed item(s) to be sent.

	// LRT - 96/12/26 2:12 PM
	Re-enabled the calls to GC in "ExtractPart", "ER_AM2" and "ER_AcceptPart"
	to test whether excess storage is still grabbed.
	No difference detected so disabled GC again.

	// LRT - 96/12/26 6:48 PM
	Switched to setting slots in our root frame to NIL before calling
	RemoveSlot.

1.4FC05
	// LRT - 97/01/02 1:04 PM
	Modified the way that the rx Extensions function "XDecodeData" is called
		XDecodeData ( srcUnicode, destBinObj, part );
	XDecodeData can now use/modify slots in "part" when it knows what's there.

	// LRT - 97/01/02 1:51 PM
	Modified status dialog's "required memory" display to more accurately
	reflect the amount of storage that is being requested to download an
	item from the POP server

POP List Manager 1.4FC05
	// LRT - 97/01/08 4:47 PM
	Added "theList.textListScrollers.ypos := 0;" prior to "theList:RedoChildren()"
	in Read/Delete picker's "labelActionScript"
	Bug:
		1616539 - scrolling arrows not refreshed when toggling between Read/Delete

Resolve inet URL 1.4FC05
	// LRT - 97/01/08 7:41 PM
	Added a forward scan parser to skip leading ">" characters from URLs in
	reply or forwarded messages.
	Bug:
		1616593 - Resolve URL not working if there is a ">" before the URL

1.4FC06
	Fixed problem in GrabLink which prevented use of MacIP.
	Added a patch for VBO bug which keeps VBOs in a soup entry.
	Switched to soup entries for POP list.

1.4FC07 (07d1, 07d2 and 07)
	// LRT - 97/01/22 2:08 PM
	For reception of messages with long subjects, truncate the displayed subject
	text to allow the required storage "<1463K>" to show in the status display.
	Modified N1_Service functions "SetStatusCount" and "SetStatProcess"

	// LRT - 97/01/22 2:23 PM
	Added error handling for failure of POP server to deliver the headers in
	a timely fashion - ie: more than 2 minutes passes!

	// LRT - 97/01/24 7:24 PM
	Switched to using NIE 1.1 equate files from Apple FTP site
	Only 1 bug was found in the include files.

	// LRT - 97/01/24 9:35 PM
	Added code to clean up any left-over VBO soup entries if a fatal error
	had caused one to linger

	// LRT - 97/01/26 11:15 AM
	Deferring my final cleanup call to work around NIE's habit of calling
	the GrabLink callback TWICE with -16005 when it is cancelled.

	// LRT - 97/01/23 11:48 PM
	Added error handling for NIE endpoint out of memory error during transmit

	// LRT - 97/01/24 11:24 PM
	Lowered packet size of outbound packets being dumped in rapid succession
	during SMTP message body tx from 1K to 512 bytes.

	// LRT - 97/01/24 2:59 AM
	Switched storage of outbound packets from VBO to heap as there was no
	need to put such small strings on a store.

	// LRT - 97/01/24 10:58 PM
	// LRT - 97/01/24 11:02 PM
	Added another state to the SMTP body transmit state machine to further
	desyncronize the NIE packet dumps.

	// LRT - 97/01/24 4:32 PM
	Added special-case handling of outgoing message content containing lines
	which begin with "From: ..." to prevent SMTP hangup with some servers.

	// LRT - 97/01/24 10:09 PM
	Removed an extra <CR>LF> from the transmitted message which had been
	detected between the RFC822 headers and the start of the message body.

	// LRT - 97/01/24 10:26 PM
	Removed an extra <CR>LF> from the transmitted message which had been
	detected between the end of the message body and the final period.

	// LRT - 97/01/24 10:08 PM
	Changed header spelling from "TEXT/PLAIN" to "text/plain"
	This change was made for aesthetic reasons only.

	// LRT - 97/01/24 10:24 PM
	Added extra preventative measures to prevent message text VBOs from
	residing on the wrong store.
	This case would never have occured but it had been coded poorly.

	// LRT - 97/01/24 4:07 AM
	Filtering non-ASCII characters from message subjects before transmitting.

	// LRT - 97/01/27 12:51 PM
	Trying to minimize amount required just to read the header
	Was requesting 16K storage in heap or VBO but now only need 8K.

	// LRT - 97/01/27 1:38 PM
	Added code for "ShowHelpView" to open Celso's help books for transport
	prefs and the Rule Editor.

1.4.1a1
	// LRT - 97/03/18 2:12 AM
	Implemented fix for MacIP which should repair the NIE 1.2 bug
	- More rigourous insurance that I won't use undocumented slots
	unless they are known to be something I need so that we will
	not have a problem with values we don't expect.
	AS:
		if newStatus.info	// NEW: check for slot before use
		and IsSymbol ( newStatus.info )
		and HasSlot ( myTitlesFrame, newStatus.info ) then

1.4.1a2
	// LRT - 97/03/20 7:24 PM
	Try to prevent the "Celso P. Maiolo" <> from address
	bug caused by having an owner card which has ONLY a
	cc:Mail or QuickMail email address

		N1_Transport function "epcon"
			// OLD WAY:
			//if userMails and Length(userMails) > 0 then
			//	begin
			//	local fromRef := Clone ( userMails[0] );
			//	end;
			//enRoute._fromEmailAddr  := if fromRef and fromRef.email then
			//		:NormalizeAddress ( fromRef );
			//	else
			//		nil;
			// NEW <post-1.4>
			if userMails and Length(userMails) > 0 then
				begin
				local i;
				for i := 0 to Length(userMails) - 1 do
					begin
					local fromRef := Clone ( userMails[i] );
					enRoute._fromEmailAddr := if fromRef and fromRef.email then
						:NormalizeAddress ( fromRef );
					if StrFilled ( enRoute._fromEmailAddr ) then
						break;
					end;
				end;

	// LRT - 97/03/20 7:13 PM
	Fix for owner email address incorrectly resolved to empty string
	from cc:Mail or QuickMail non-internet formats.

		N1_Transport function "epcon"
			// NEW:
			if not StrFilled ( enRoute._fromEmailAddr ) then
				enRoute._fromEmailAddr  := nil;

	// LRT - 97/03/24 4:47 PM
	Added code to translate non-USASCII characters in subject to 7-bit
	equivalent using the same function that is used to convert the
	message body text.

		N1_Service function "SM_SMTP"
			// WAS:
			//local msgSubj := StringFilter ( currentItem.title, kStd7BitASCIIChars, 'passAll );
			// NEW:
			local msgSubj;
			local convFunc := func ( str, newOff )
				begin
				msgSubj := str;
				nil;			// exit from "kWrapTxAsyncFunc"
				end;

			local bin := MakeBinary ( 512, 'binary );
			call kWrapTxAsyncFunc with ( currentItem.title, bin,
				0, 128, convFunc, NIL );

			TrimString ( msgSubj );		// remove trailing <CR>

			// Place this 7-bit US-ASCII conversion back
			// into the message item's title slot
			// (no need to EntryChange due to itemCompleted later)
			currentItem.title := msgSubj;

			if kDebugOn then			// TEST
				begin
				write ( "SUBJECT: " );
				print ( msgSubj );
				end;
			// end of NEW <>


	// LRT - 97/03/24 4:47 PM
	Added code to translate non-USASCII characters in file names to 7-bit
	equivalent using the same function that is used to convert the
	message body text.
		N1.funcDefs2 function "k_EncMakeHeaderFunc"
			// WAS:
			//enc.fName := TrimString ( enc.fName );
			// NEW:
			local usAscii;
			local convFunc := func ( str, newOff )
				begin
				usAscii := str;
				nil;			// exit from "kWrapTxAsyncFunc"
				end;

			local bin := MakeBinary ( 512, 'binary );
			call kWrapTxAsyncFunc with ( enc.fName, bin,
				0, 128, convFunc, NIL );

			TrimString ( usAscii );		// remove trailing <CR>
			enc.fName := usAscii;
			// end of NEW <>

1.4.1a3

	// LRT - 97/03/27 12:51 AM
	Fix for bug reported by obrien@leonardo.net (Mike O'Brien)

	// Moved from later position to cover ALL responses as
	// specified by RFC-821 Appendix E

	Moved code in N1_Service function "SM_SMTP" (SMTP State Machine)
	from where it had been only handling multi-line responses after
	the 'HELO' state to before ALL response states.
	This is now the correct position since we have discovered the
	bug <LRT - 97/03/27 2:28 PM> which made me move it away from
	here in the first place.

	Reference document: RFC-821 Appendix E

		N1_Service function "SM_SMTP
			...
			if data[3] = $- then
				begin
				return;			// ignore the continuation line
				end;
			...


1.4.1a4

	// LRT - 97/03/27 2:28 PM
	Found direct cause of bug reported by obrien@leonardo.net (Mike O'Brien)

	Fix for NOS SetInputSpec(NIL) bug which drops pending input data
	when InputSpec is set back again from AddDelayedSend

	Bug report passed on to NSG by Ryan Robertson
	Changes approved by Ryan Robertson

		N1_Service inputScript "SMTP"
			// LRT - 97/03/27 2:28 PM
			// fix for NOS SetInputSpec(NIL) bug which drops
			// pending input data
			if ep.v_SMTP_state = kState_smtpData then	// ONLY UNDER THIS CONDITION

	and:
		N1_Service SM_SMTP state machine:
			// LRT - 97/03/27 2:46 PM
			// fix for NOS SetInputSpec(NIL) bug which drops
			// pending input data.
			// No longer any need for call to SetInputSpec here
			//:SetInputSpec ( is.SMTP );



	// LRT - 97/03/29 8:16 PM
	Due to the "97/03/27" fix for the InputSpec loss of data, we no longer
	need the "Looking up user address" phase of SMTP connection.

	Original justification for the phase
	------------------------------------
	I had included this phase in response to a bug report which related to
	a very old SMTP server which responded to "HELO [198.191.36.13]" with a
	lengthy response which looked like:
		250-The specified domain name does not match your local DNS entry.
		250-Please contact your support administrator to rectify this problem.
		250-Your correct DNS entry should be "EV3a.54-7.inforamp.net"
		250 Welcome EV3a.54-7.inforamp.net [198.191.36.13]

	Due to the InputSpec loss of data, most of this was dropped by the endpoint.

	When I did a DNS lookup of 198.191.36.13 from the Newton it gave me
	EV3a.54-7.inforamp.net so I added code to do the lookup and use what I
	called the "true name" and the resulting session looked like:

		EnRoute:  HELO EV3a.54-7.inforamp.net
		Server:   250 Welcome EV3a.54-7.inforamp.net [198.191.36.13]

	It was odd that the DNS seems to have been OK in the 1st case but the
	new method worked with ALL servers, so I switched to it in 1.3d06

	Change to EnRoute i-net transport
	---------------------------------
	Added a compile-time constant 'k_BUILD_FLAG_SKIP_UA_LOOKUP to control
	whether or not the code for this feature is included in the build and
	tested the result against all of my problematic SMTP servers to see if
	there were any undesireable side-effects. (Checked out fine!)

	Setting k_BUILD_FLAG_SKIP_UA_LOOKUP to TRUE skips the entire "trueName"
	lookup phase during SMTP connect. This speeds up the connection process
	by as much as 20 seconds on some servers with slow DNS response time.

	NOTE:
	Apple Newton Systems Group must OK this change before the release of a
	final version with the k_BUILD_FLAG_SKIP_UA_LOOKUP flag set to true.


1.4.1a5

	// LRT - 97/04/01
	Changed German translation of the transport group title from "Versenden"
	to "Mail"
	Bug:
		1642016 - Routing button should show "Mail" not "Versenden"

	// LRT - 97/04/01
	Changed German Extras name of the transport "EnRoute internet"
	to "EnRoute Internet"
	Bug:
		1643188 - Tapping EnRoute Internet icon in Extras Throws -48204


1.4.1a6

	// LRT - 97/04/04 1:26 AM
	I inadvertently had included the English VDef instead of the German
	for the EnRoute Internet Info.
	Switched to the German "info VDef" to correct translation errors
	for "POP Host", "SMTP Host", etc.
	Bug:
		1643551 - EnRoute Internet info strings not translated
		1643563 - EnRoute Internet info strings not translated


1.4.1a7

	// LRT - 97/04/04 10:30 PM
	It was brought to my attention via a post to the comp.sys.newton.misc
	newsgroup by Mark Vellek <mvellek@thoughtport.com> that there was a
	problem with EnRoute and the POP server "pop.thoughtport.com"

	EnRoute would stop processing input during the UIDL phase of sending
	mail. On further exploration, I discovered that the output from that
	server in response to the UIDL command was a series of lines terminated
	by <LF> instead of the normal <CR><LF> of most servers. (NOT TO SPEC)

	As a solution which is still compatible with normal <CR><LF> POP servers,
	I've modified the inputSpec which is active during the login phase of
	a POP session to use <LF> termination instead of <CR><LF> termination.
	The only other code change which had to be made was to strip the <LF>
	chars from the ends of the lines in the inputSpec's inputScript.
	This tests out 100% with all of the POP servers I have access to and
	still conforms to the POP RFC documents.

		Modified N1_Service frame "is.POPLogin"

			{
			...
			// LRT - 97/04/04 10:30 PM
			// Here's a curious way to handle the WIERD POP server
			// that only sends <LF> as termination for UIDL lines
			// at "pop.thoughtport.com"
			// This peculiarity was brought to our attention 97/04/01
			// by Mark Vellek <mvellek@thoughtport.com> when he posted
			// to the comp.sys.newton.misc newsgroup.
			// WAS:
			//termination:	kis_CRLF_Term,	// was triggering on <CR><LF>
		a)	// NEW:
			termination:	kis_LF_Term,	// trigger on just the <LF> instead
			filter:			kis_StripCRs,	// so all POP servers seem the same!
			// END OF NEW

			InputScript:	func ( ep, data, term, opts )
				begin
				try
					// LRT - 97/04/04 10:30 PM
					// strip the <LF> here to reduce changes in "SM_POPLogin"
		b)			// NEW:
					StrReplace ( data, "\u000A", k_EmptyString, nil );
					// END OF NEW

					ep:SM_POPLogin ( data );
					...


	// LRT - 97/04/05 12:12 AM
	People are having difficulty switching between multiple owners if NIE
	is left open during mail sessions.

	Here's an implementation of a Receive/Send-time check to see whether an NIE
	connection is already open where a slip is be opened for those who
	have more than one owner card to allow them to easily switch to a different
	owner.  Up to this time, people have been disconnecting the NIE connection
	to switch POP accounts during a single connection.

	NOTE: This is a proposal for a new feature and it can be removed easily from
	later builds by setting the K_BUILD_FLAG_SIMPLECONN flag to nil. I don't
	feel that the UI is going to require any explanation as it appears as a
	stripped down version of the standard NIE connection slip.

		Added code to N1_Transport function "RequestDoSlip"

			// LRT - 97/04/05 12:12 AM
			// Here is where I should check to see whether an NIE
			// connection is already open so that I can bring up
			// a slip allowing the user to select which owner info
			// they would like to use.
			// The connect button of this slip will then call the
			// same callback as InetOpenConnectionSlip would have.
			// NEW:
			if K_BUILD_FLAG_SIMPLECONN then
				begin
				local linkStat := InetGetLinkStatus(nil);
				if linkStat = 'Connected then
					begin
					local numOwners := GetUnionSoup( ROM_cardfilesoupname ):Query (
						{
						validTest: func(e) e.class = 'owner,
						} ):CountEntries();
					if numOwners > 1 then
						begin
						local slip := BuildContext ( GetLayout("ownerConn") );
						slip.theTransport := self;
						slip.closeScript  := cb;
						slip:Open();
						return;
						end;
					end;
				end;
			// END OF NEW

			InetOpenConnectionSlip ( nil, self, cb );
			...

1.4.1a8

	// LRT - 97/04/11 3:33 PM
	Changed C compiled function "UUEncodeAsyncTx" to fix bug which caused
	enclosures whose length was an exact multiple of 45 to have invalid
	termination strings.
	Moved the initialization of a pointer to a position before "break;"
	instead of immediately after.
	Bug:
		1646274 - "Attachment Corrupt" dialogue on Eudora/Desktop

	// LRT - 97/04/11 5:44 AM
	************
	INTERNAL DOC
	************
	Added code to ensure that the enclosure filename line is short enough to
	prevent the error message in Eudora Desktop
	N1.FuncDefs2 function "k_EncMakeHeaderFunc"
	Bug:
		1646274 - "Attachment Corrupt" dialogue on Eudora/Desktop


	// LRT - 97/04/11 5:33 AM
	************
	INTERNAL DOC
	************
	Changed function "k_TimeTo822Func" to not rely on Newton OS to build
	the standard RFC-822 Date string which is specified as an ENGLISH date
	and must not be localized!
	Bug:
		1646274 - "Attachment Corrupt" dialogue on Eudora/Desktop


	// LRT - 97/04/11 2:29 PM
	************
	INTERNAL DOC
	************
	Added code to handle email client which sends "Subj:" instead of "Subject:"

		N1_Service function "SM_POPHeader"

			// Somewhere out there is an email client that says
			// "Subj:"
			if not sPos then
				sPos := StrPos ( theTxt, "\nSubj:", 0 );

	// LRT - 97/04/11 2:29 PM
	************
	INTERNAL DOC
	************
	Added code to handle email client which sends ">From :" instead of "From:"

		N1_Service function "SM_POPHeader"


	// LRT - 97/04/13 2:05 AM
	************
	INTERNAL DOC
	************
	Added more robust check for "R" in "Status:"

		N1_Service function "SM_POPHeader"


1.4.1a9
	// LRT - 97/04/15 7:30 AM
	Modified a character translation in the C-code routine for
	special character to US-ASCII character conversion.
	Bug:
		1640918 - Umlauts omitted from...

		Was using "" -> "B"
		Now using "" -> "s" as recommended by Ingrid Orlow


	// LRT - 97/04/15 8:00 AM
	Since the US-ASCII character conversion is now used in many places,
	it is worth rewriting as a const function.

		N1.funcDefs - new const function

			DefConst ( 'k_SpecialToUSAsciiFunc, func ( hasSpecials )
				begin
				local usAscii;
				local convFunc := func ( str, newOff )
					begin
					usAscii := str;
					nil;			// exit from "kWrapTxAsyncFunc"
					end;

				local bin := MakeBinary ( 512, 'binary );
				call kWrapTxAsyncFunc with ( hasSpecials, bin,
					0, 128, convFunc, NIL );

				TrimString ( usAscii );		// remove trailing <CR>
				end );


	// LRT - 97/04/15 8:41 AM
	Modified code for translating non-US-ASCII characters in outgoing
	RFC-822 internet addresses so that replacement of special characters
	is now used instead of removal.
	Bug:
		1640918 - Umlauts omitted from... (see Jeremy Bierbach note)

		N1.funcDefs const function "k_StrTo822QuotesFunc"

			// LRT - 97/04/15 8:41 AM
			// user names with special chars need better translation
			// than just stripping out non-ASCII
			// WAS:
			//str := StringFilter ( str, kStd7BitASCIIChars, 'passAll );
			//TrimString ( str );
			// NEW:
			str := call k_SpecialToUSAsciiFunc with ( str );


	// LRT - 97/04/13 10:09 PM
	Implemented RFC-1522 MIME Part 2 decoding of =?iso8859-1?Q?...?= for
	all fields in received headers.
	Feature can be disabled by setting K_BUILD_FLAG_MIMEPART2 to NIL;

	// LRT - 97/04/13 9:25 PM
	************
	INTERNAL DOC
	************
	Fixed bug in function "k_TimeTo822Func" where "Sun" was showing empty.
		// Sunday is dayOfWeek ZERO

		// WAS:
		//local weekdaysA := [ nil, "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" ];
		// NEW:
		local weekdaysA := [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ];


1.4.1a10
	// LRT - 97/04/15 7:30 AM
	Modified two more character translation in the C-code routine for
	special character to US-ASCII character conversion as requested
	by Yannick Bertolus.
	Bug:
		1647924 -  &  should be replaced by o and O (currently, it's 0 - zero)

		Was using "" -> "0" (zero)
		Now using "" -> "o" (lowercase o)

		Was using "" -> "0" (zero)
		Now using "" -> "O" (uppercase o)


1.4.1a11

	// LRT - 97/04/22 1:49 AM
	Fixed bug where addresses containing commas from MS-MAIL 5.0 were being
	incorrectly interpreted by header parser "Titze, Les" <lrtitze@io.org>
	as reported by "Les Murphy" <Les_Murphy@compuware.com>

		Modified N1_Service function "SM_POPHeader"

			a)	currRxMsg.txtTo :=
					call k_822QuotesToOptsFunc with ( currRxMsg.txtTo );

			b)	currRxMsg.txtCC :=
					call k_822QuotesToOptsFunc with ( currRxMsg.txtCC );

		Modified N1.funcDefs2 function "k_AddrFrom822Func"

			// WAS:
			// if CharPos ( namePart, $\20, 0 ) then
			// NEW:
			if ( spacePos := CharPos ( namePart, $\2C, 0 ) ) then
				begin
				// has a comma therefore is "Last, First"
				nameF.name.last  := Substr ( namePart, 0, spacePos );
				nameF.name.first := Substr ( namePart, spacePos+1, 9999 );
				end;
			else if CharPos ( namePart, $\20, 0 ) then
			// END OF NEW  97/04/22


	// LRT - 97/04/22 1:04 AM
	************
	INTERNAL DOC
	************
	Fixed bug where date field was missed when MS-MAIL wrapped ALL header lines
	as reported by "Les Murphy" <Les_Murphy@compuware.com>

		Modified N1_Service function "SM_POPHeader"

			// WAS:
			//eolPos := CharPos ( theTxt, $\n, sPos + 4 );
			//currRxMsg.dateString := Substr ( theTxt, sPos + 7, eolPos - sPos - 7 );
			// NEW:
			sPos := CharPos ( theTxt, $:, sPos );
			currRxMsg.dateString := TrimString ( call funcUnwrappedLine with ( theTxt, sPos+1 ) );


	// LRT - 97/04/22 3:09 AM
	************
	INTERNAL DOC
	************
	Extended the type of connection error codes which can cause a redial attempt
	if :GetConfig ( 'enRouteRedialAttempts ) is set to an integer value

		Modified N1_Transport function "CB_Link_Grab"

			// WAS:
			//if enRoute and enRoute.v_redials and enRoute.v_redials > 0
			//and err = -24002 then
			// NEW:
			if enRoute and IsInteger(enRoute.v_redials) and enRoute.v_redials > 0
			and (
			err = -24002 or		// "There is no answer"
			err = -24003 or		// "The phone number is busy"
			err = -24004 or		// "There is no answer"
			err = -60504 or		// "Internet Link disconnected"
			err = -60505 or		// "Internet connection failed"
			err = -60057 or		// "connection to network may have dropped"
			err = -60015		// "Can't establish link. PPP Negot failed"
			) then


	// LRT - 97/04/22 4:07 AM
	************
	INTERNAL DOC
	************
	Added a check for :GetConfig ( 'saveHdrsInMsg ) so that the full header text
	can be kept in the "headerText" slot of messages read into the inBox for viewing
	with a tag extension.

		Extended N1_Service function "ER_AM3"

			// NEW:
			if :GetConfig ( 'saveHdrsInMsg ) then
				begin
				currRxMsg.headerText := currRxMsg.fullHeader;
				end;


	// LRT - 97/04/22 4:25 AM
	************
	INTERNAL DOC
	************
	Added a check for :GetConfig ( 'saveHdrsInPOPList ) so that the full header text
	can be kept in the "headers" slot of POP List soup entries to aid in the use of
	the UIDL command.

		Extended N1_Service function "SM_POPHeader"

			// NEW:
			if :GetConfig ( 'saveHdrsInPOPList ) then
				thisLItem.headers := TrimString(theTxt);


1.4.1B2

	// LRT - 97/05/03 1:07 AM
	Added code to check message headers for "Sender:" info to append to "From:" info
	so that the Rules filter can use (see) source addresses which are generated by
	mailing lists.
	This corresponds to a modification in Rules Filter 1.4.1B2 which allows it to
	use the new "txtFrom" slot if available.

		Extended N1_Service function "SM_POPHeader"

			currRxMsg.txtFrom := thisLItem.from;

			sPos := StrPos ( theTxt, "\nSender:", 0 );

			if sPos then
				begin
				sPos := CharPos ( theTxt, $:, sPos );
				tempTxt := call funcUnwrappedLine with ( theTxt, sPos+1 );

				currRxMsg.txtFrom := txtFrom & $, && tempTxt;
				end;

	// LRT - 97/05/05 2:57 PM
	Found a fix for the strange bug reported by David Nanian <dnanian@uw.com>
	where a solitary message would never load.
	It turned out to be a bug in my partialScript / InputScript logic for
	messages whose packets end with "\n."
	The inputScript tries to SetInputSpec after being called by Input() and
	an exception cancels without setting a flag to tell me it was OK to do so!


1.4.2a2

	// LRT - 97/05/01
	Added code to preserve UIDL info such that receiving can proceed at a rapid
	rate if UIDL is supported and headers are saved in POP List

1.4.1FC1

	// LRT - 97/05/09 4:44 AM
	Version number change only


1.4.1FC2

	// LRT - 97/05/23 2:35 AM
	Changed translation text to match change made earlier in EnRoute Core
	BUG:
		1648787	- inconsistent translation for inktext conversion alert

		WAS:
			"Bitte stellen Sie sicher, da die elektronische Tinte korrekt konvertiert wurde.",
		NEW:
			"Bitte prfen Sie, ob die elektronische Tinte korrekt umgesetzt wurde.",

	// LRT - 97/05/23 2:35 AM
	To resolve the ink convert title viewbounds problem reported in bug 1648787, I
	changed the German text from "i-net Post POP-Benutzername wird konvertiert"
	to simply "POP-Benutzername wird konvertiert"
	The viewbounds of the title text is set by the OS so my only solution was
	to shorten the text.
	BUG:
		1648787	- inconsistent translation for inktext conversion alert

		// LRT - 97/05/23 2:47 AM
		// WAS:
		//cvtPOPUserTitle: "^0 POP-Benutzername wird konvertiert",
		// which read as: "i-net Post POP-Benutzername wird konvertiert",
		// one which fit: "i-net Post POP-Host konvertieren",
		//NEW:
		cvtPOPUserTitle:  "POP-Benutzername wird konvertiert",


1.4.1FC3

	// LRT - 97/06/03 2:01 AM
	Modified comma-replacement scheme for handling MS-Mail email address
	commas so that it uses the <ESC> 0x1B character instead of opt-C
	because StrReplace actually converts "\u00E7" to "c" before doing
	the string replace and therefore removes not only 0xE7 chars but also
	all "C" chars and "c" chars!
	BUG:
		1656888	- letter 'C' translated to commas in To: header of rx msgs


1.4FC4

	// LRT - 97/06/04 8:07 PM
	Fixed bug in SM_POPHeader_141 that was causing an exception
	which was reported by Jeremy Bierbach
	This was happening in the routine where the "Sender" field is
	appended to the "txtFrom" info to allow the filters to reject
	messages from newsgroups.
	Bug:
		1657553 - EnRoute throws on questionable characters in header


	// LRT - 97/05/23 2:35 AM
	To resolve the ink convert title viewbounds problem reported in bug 1648787, I
	had changed the German text from "i-net Post POP-Benutzername wird konvertiert"
	to simply "POP-Benutzername wird konvertiert"
	This was still reported to be too long so it has now been changed to
	simply "Benutzername wird konvertiert"
	BUG:
		1648787	- inconsistent translation for inktext conversion alert

		// LRT - 97/05/23 2:47 AM
		// WAS:
		//cvtPOPUserTitle: "^0 POP-Benutzername wird konvertiert",
		// which read as: "i-net Post POP-Benutzername wird konvertiert",
		// one which fit: "i-net Post POP-Host konvertieren",
		//NEW:
		cvtPOPUserTitle:  "POP-Benutzername wird konvertiert",


	// LRT - 97/06/04 9:25 PM
	Added a timeout to "k_smtpBodyOutSpec" callback frame so that no response
	from NIE after an attempted transmit to the SMTP server will result in an
	error message being displayed.

	// LRT - 97/06/05 5:25 AM
	Changed the displayed storage "<1463K>" to show the more descriptive
	12K (98K required during receive)
	Modified N1_Service functions "SetStatusCount" and "SetStatProcess"


EnRoute Regel-Editor 1.4.2b01

	// LRT - 97/07/25 7:41 PM
	Added the suggested translation for "Modified:" and also fixed the
	year/time spacing problem described in the bug report.
		Localization:
			// WAS:
			//created:	"Erstellt: ^0^1",
			//modified:	"Erstellt: ^0^1",
			// NEW:
			created:	"Erstellt: ^0 ^1",
			modified:	"Modifiziert: ^0 ^1",
	BUG:
		1661569	- printed rules in German show "Erstellt" insead of "Modifiziert"

i-net Grenfilter  1.4.2b01 D
	// LRT - 97/07/25 8:18 PM
	Changed German translation text
		// fix for bug report #1661566
		// "byten" should read "Byte"
		// WAS:
		//dispAs_Bytes:		"^0 byten",
		// NEW:
		dispAs_Bytes:		"^0 Byte",
	BUG:
		1661566	- Size filter shows "Byten", should be "Byte"

1.4.2b01
	// LRT - 97/07/28 3:25 AM
	Changed German help book text
	BUG:
		1654324 - Help screens: ref to "Verbindung abbrechen" should be "Abbrechen"


1.4.2B02
	// LRT - 97/08/24 8:37 PM
	Added the following to the transport's "defaultConfiguration"
		// default to NO AUTO_PUT_AWAY
		dontAutoPutAway:	'never,
	This decision was based on advice from Yannick Bertolus saying:
	"Currently, certain received mail items are put away automatically.
	The default should be not to put away automatically (until we add a
	pref - see 1665623)."
	BUG:
		1666919 - Received mail items should not be put away automatically

	// LRT - 97/08/24 8:48 PM
	Removed my test for the existence of a default link ID as it was not required.
	BUG:
		1668268 - "There is no Internet Setup" when mail w/ updated NIE 1.0 soup

1.4.2B03
	// LRT - 97/09/05 1:47 AM
	Added handling for a user's "Reply-To" preference (for later)
		N1_Transport.CB_ConnSlip_Inet
			:SetConfig ( 'enRouteReplyTo,   uAccess.enRouteReplyTo );
		N1_Transport.epcon
			v_replyTo: 			:GetConfig ( 'enRouteReplyTo ),
		N1_Service.SM_SMTP
			if v_replyTo then
				begin
				call funcSMungeAppend with ( header, "Reply-To: " );
				call funcSMungeAppend with ( header, v_replyTo );
				call funcStrMungeCRLF with ( header );
				end;

Core 1.4.2B03
	// LRT - 97/09/05 12:59 AM
	Added handling of body class 'MIME in "ER_PrepEnc"
		// Adding handler for app-specific MIME part
		else if ClassOf ( boxItem.body ) = 'enRouteMIME
		and boxItem.body.data
		and StrFilled ( boxItem.body.headers ) then
			begin
			if kDebugOn then print ( " - Application MIME enclosure" );

			encFrame.class    := 'enRouteMIME;
			encFrame.data     := boxItem.body.data;
			encFrame.headers  := boxItem.body.headers;
			encFrame.encoding := boxItem.body.encoding;
			encFrame.text     := boxItem.body.text;		// msg body text
			end;


	// LRT - 97/09/09 4:08 AM
	Is the 20K heap object workaround still a requirement???
	I'll try to use any size in RAM if there's a HUGE heap

		N1.funcDefs
			//if maxReqd < 20480 AND freeHeap > maxReqd then
			//   ===============

			if freeHeap > ( maxReqd + 4096 ) AND
			( freeHeap > 98000 or maxReqd < 20480 ) then


1.4.3a01
	Added scrollbar to viewer
	Added header viewing to scrollbar
	Added options to control saving headers in POP List soup
	Fixed UIDL bug related to truncating final char from ID

1.4.3a02
	// LRT - 98/02/09 4:29 AM
	Now allowing timed connections to read mail regardless
	of the user config setting for "After Sending...".

	// LRT - 98/02/10 2:23 AM
	Adding support for <] Action Tag "Delete from server"
	using POP List Soup references saved in inBox items.

		N1_Service.ER_AM3

			// LRT - 98/02/10 2:23 AM
			// adding support for <] Action Tag "Delete from server"
			if not doDeletion and IsSoupEntry ( mailList[mailListCtr] ) then
				begin
				currRxMsg.popListItem := MakeEntryAlias(mailList[mailListCtr]);
				end;


===================================================================================
TO-DO (ideas for future enhancement)

	N1_Transport function "NormalizeAddress"
	  - modify so that user can create valid internet addresses
	    for their local server which do not have any "@"


	EnRoute Core C_Transport.ItemPutAway
	  - to prevent the loss of text which is different than the attachment,
	    create a new inBox item containing a clone of the item without
	    the "attachment" and "body" slots.


	EnRoute i-net transport
		- should call InetGetLinkStatus(nil) and check for
		  'idle or 'connected in "RequestDoSlip"
		  See the existing comment in N1_Transport function "RequestDoSlip"
			// Here is where I should check to see whether an NIE
			// connection is already open so that I could bring up
			// a slip allowing the user to select which owner info
			// they would like to use.

		- implement MIME Message Header Extensions for Non-ASCII Text
		  as documented in RFC-1522 to handle header fields such as:

			To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld@dkuug.dk>


\*********************************************************************************/
